The Absolute Beginners Guide To Amos ------------------------------------- Chapter eighteen ---------------- If you take a look at EXAMPLE18.Amos you will see it is a small Procedure that you could use in your programs during development. The Procedure is called _SYSTEMSTATUS and when called will display the following information: FAST MEMORY FREE CHIP MEMORY FREE TOTAL MEMORY FREE DISK SPACE FREE DF0: DISK SPACE FREE DF1: (If exists) VARIABLE SPACE FREE The program is very straight forward and you should have little trouble understanding it, but as usual I will cover each new command in detail. This is a good example of how useful Procedures can be. You could build up a library of Procedures which you could use many times over in your programs saving lots of development time, just like the Pro`s do. DFREE ----- Returns the space left on the currently in use disk, in bytes. For example: PRINT DFREE EXIST: ----- You can use this command to find out if a file or drive EXISTs. Some examples: IF EXIST (PIC.IFF) THEN LOAD IFF etc....... IF EXIST (df1:) THEN DIR$="DF1:" DIR$= ----- Set the current directory or drive. DIR$="DF1:" Set the current drive to DF1: DIR$="DF0:" Set the current drive to DF0: DIR$="DF0:PICS/" Set the directory to PICS drawer of the disk in DF0: FAST FREE --------- PRINT FAST FREE would print the amount of FAST memory available in bytes. CHIP FREE --------- PRINT CHIP FREE would print the amount of CHIP memory available, this can be used to good effect. For example, if you wanted to check if the Amiga your program was running on had more than 512k then you could do this: IF CHIP FREE+FAST FREE>512*1024 then ............... That covers all the new commands that pop up in EXAMPLE18.Amos. Here are a few more that may be of use or interest to you especially if you are thinking of writing a utility program that needs to manipulate disks and files etc. --------------------------------------------- KILL Filename$ -------------- KILL deletes the file in Filename$ from the current drive, once KILLed you will not be able to recover this file. An example: KILL "readme.doc" Will delete the file readme.doc RENAME old$ TO new$ ------------------- Allows you to change the name of a file. As an example let us say we want to RENAME readme.doc TO instructions.doc, we would execute the following: RENAME readme.doc TO instructions.doc MKDIR ----- Creates a drawer (or folder if you like) on the current disk. As an example lets say we need a drawer to store our samples in we would: MKDIR "samples" LDIR ---- Lists the current directory of your disk to the printer. LLIST ----- Executing this command will print out your Amos program listing to your printer. This command does not work on some versions of Amos. * See Chapter 20 for how to get round this. LPRINT ------ You can use this in exactly the same way as PRINT except the output is to your printer: LPRINT "THIS TEXT WILL BE SENT TO MY PRINTER" OK that is enough new commands for this chapter. End of chapter eighteen ^^^^^^^^^^^^^^^^^^^^^^^